package com.huitone.smspfm.socket.protocol.sgip.constant;


/**   
* @Title ErrorCode.java 
* @Package com.huitone.smspfm.socket.protocol.sgip.constant 
* @Description TODO(用一句话描述该文件做什么) 
* @author ybliang   
* @date 2017年3月23日 下午2:23:50 
* @version V1.0   
*/
public class ErrorCode {

	/**
	 * 无错误，命令正确接收
	 */
	public static int CODE0 = 0;
	
	public static String CODE0_DESC = "无错误，命令正确接收";
	
	/**
	 * 网关连接错误
	 */
	public static int CODE1 = 1;
	
	public static String CODE1_DESC = "网关连接错误";
	
	/**
	 * SP错误
	 */
	public static int CODE2 = 2;
	
	public static String CODE2_DESC = "SP错误";
	
	/**
	 * 报文错误
	 */
	public static int CODE3 = 3;
	
	public static String CODE3_DESC = "报文错误";
	
	/**
	 * 网关拦截
	 */
	public static int CODE4 = 4;
	
	public static String CODE4_DESC = "网关拦截";
	
	/**
	 * 超时
	 */
	public static int CODE5 = 5;
	
	public static String CODE5_DESC = "超时";
	
	/**
	 * 短消息内容非法
	 */
	public static int CODE6 = 6;
	
	public static String CODE6_DESC = "短消息内容非法";
	
	/**
	 * 发送量超过限制
	 */
	public static int CODE7 = 7;
	
	public static String CODE7_DESC = "发送量超过限制";
	
	/**
	 * 发送消息失败
	 */
	public static int CODE8 = 8;
	
	public static String CODE8_DESC = "发送消息失败";
	
	/**
	 * 过期
	 */
	public static int CODE9 = 9;
	
	public static String CODE9_DESC = "过期";
	
	/**
	 * 拒绝
	 */
	public static int CODE10 = 10;
	
	public static String CODE10_DESC = "拒绝";
	
	/**
	 * 鉴权计费错误
	 */
	public static int CODE11 = 11;
	
	public static String CODE11_DESC = "鉴权计费错误";
	
	/**
	 * 禁发时段不接收禁发短信
	 */
	public static int CODE_1 = -1;
	
	public static String CODE_1_DESC = "禁发时段不接收禁发短信";
	
	/**
	 * 重复短信
	 */
	public static int CODE_2 = -2;
	
	public static String CODE_2_DESC = "重复短信";
	
	/**
	 * 包含敏感词短信
	 */
	public static int CODE_3 = -3;
	
	public static String CODE_3_DESC = "包含敏感词短信";
	
	/**
	 * 黑名单用户短信
	 */
	public static int CODE_4 = -4;
	
	public static String CODE_4_DESC = "黑名单用户短信";
	
	/**
	 * 无效用户短信
	 */
	public static int CODE_5 = -5;
	
	public static String CODE_5_DESC = "无效用户短信";
	
	/**
	 * 用户号码不合法
	 */
	public static int CODE_6 = -6;
	
	public static String CODE_6_DESC = "用户号码不合法";
	
	/**
	 * 提交了业务端没有的业务类型错误
	 */
	public static int CODE_7 = -7;
	
	public static String CODE_7_DESC = "业务端没有业务类型错误";
	
	/**
	 * 短信发送端口号(扩展码)不匹配错误
	 */
	public static int CODE_8 = -8;
	
	public static String CODE_8_DESC = "短信发送端口号(扩展码)不匹配错误";
	
	/**
	 * 未匹配到网关
	 */
	public static int CODE_9 = -9;
	
	public static String CODE_9_DESC = "未匹配到网关";
	
	/**
	 * 错误管理表中没有匹配到错误信息
	 */
	public static int CODE_10 = -10;
	
	public static String CODE_10_DESC = "错误管理表中没有匹配到错误信息";
	
	/**
	 * 没有匹配到优先级列表
	 */
	public static int CODE_11 = -11;
	
	public static String CODE_11_DESC = "没有匹配到优先级列表";
	
	/**
	 * 超出最大可连接客户端数
	 */
	public static int CODE_12 = -12;
	
	public static String CODE_12_DESC = "超出最大可连接客户端数";
	
	/**
	 * 同一帐号客户端超出最大可连接数
	 */
	public static int CODE_13 = -13;
	
	public static String CODE_13_DESC = "同一帐号客户端超出最大可连接数";
	
	/**
	 * 该连接已经绑定,不需要重复绑定!
	 */
	public static int CODE_14 = -14;
	
	public static String CODE_14_DESC = "该连接已经绑定,不需要重复绑定!";
	
	/**
	 * 绑定失败,添加不成功
	 */
	public static int CODE_15 = -15;
	
	public static String CODE_15_DESC = "绑定失败,添加不成功";
	
	/**
	 * 没有登录
	 */
	public static int CODE_16 = -16;
	
	public static String CODE_16_DESC = "没有登录";
	
	/**
	 * 用户名密码校验失败
	 */
	public static int CODE_17 = -17;
	
	public static String CODE_17_DESC = "用户名密码校验失败";
	
	public static String codeDesc(int code) {
		
		String result = null;
		
		switch (code) {
		case 0:
			result = CODE0_DESC;
			break;
		case 1:
			result = CODE1_DESC;
			break;
		case 2:
			result = CODE2_DESC;
			break;
		case 3:
			result = CODE3_DESC;
			break;
		case 4:
			result = CODE4_DESC;
			break;
		case 5:
			result = CODE5_DESC;
			break;
		case 6:
			result = CODE6_DESC;
			break;
		case 7:
			result = CODE7_DESC;
			break;
		case 8:
			result = CODE8_DESC;
			break;
		case 9:
			result = CODE9_DESC;
			break;
		case 10:
			result = CODE10_DESC;
			break;
		case 11:
			result = CODE11_DESC;
			break;
		case -1:
			result = CODE_1_DESC;
			break;
		case -2:
			result = CODE_2_DESC;
			break;
		case -3:
			result = CODE_3_DESC;
			break;
		case -4:
			result = CODE_4_DESC;
			break;
		case -5:
			result = CODE_5_DESC;
			break;
		case -6:
			result = CODE_6_DESC;
			break;
		case -7:
			result = CODE_7_DESC;
			break;
		case -8:
			result = CODE_8_DESC;
			break;
		case -9:
			result = CODE_9_DESC;
			break;
		case -10:
			result = CODE_10_DESC;
			break;
		case -11:
			result = CODE_11_DESC;
			break;
		case -12:
			result = CODE_12_DESC;
			break;
		case -13:
			result = CODE_13_DESC;
			break;
		case -14:
			result = CODE_14_DESC;
			break;
		case -15:
			result = CODE_15_DESC;
			break;
		case -16:
			result = CODE_16_DESC;
			break;
		case -17:
			result = CODE_17_DESC;
			break;
		}
		
		return result;
	}
}
